﻿using System.Globalization;
using System.Windows.Controls;
using System.Windows.Data;

namespace Xioa_UI.Convert;

public class GetWidthValueFromHeightConverter : IValueConverter
{
    public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
    {
        if (value == null) return default(double);
        var res = ((string)value).Split(".").ToArray().Select(e => double.Parse(e)).ToArray();
        return res[0] - res[1];
    }

    public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}